﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeGame
{
    internal class NetworkEntityManager
    {
        private List<GameEntity> Entities = new List<GameEntity>();

        public void AddNew(string id, int x, int y, int angle, string texture, int r, int g, int b)
        {
            GameEntity ent = new GameEntity(id, x, y, angle, texture, r, g, b);
            this.Entities.Add(ent);
            Singletons.CurrentWorld.AddEntity(ent);
        }

        public GameEntity GetEntity(string id)
        {
            foreach (GameEntity item in this.Entities)
            {
                if (item.ID == id)
                {
                    return item;
                }
            }
            return null;
        }

        public bool IsValid(string id)
        {
            foreach (GameEntity item in this.Entities)
            {
                if (item.ID == id)
                {
                    return true;
                }
            }
            return false;
        }
    }
}
